<?php

define('BASE_PATH', realpath('.'));

class FunctionMap
{
    protected static $func_map = [
        'binary_search'  => '/algorithms/search/binary_search.php',
        'bubble_sort'    => '/algorithms/sort/bubble_sort.php',
        'quick_sort'     => '/algorithms/sort/quick_sort.php',
        'insertion_sort' => '/algorithms/sort/insertion_sort.php',
        'shell_sort'     => '/algorithms/sort/shell_sort.php'
    ];

    public static function autoload()
    {
        foreach (self::$func_map as $func => $file) {
            if (!function_exists($func)) {
                require BASE_PATH . $file;
            }
        }
    }
}

FunctionMap::autoload();
